export const filterRouter = (routes: any[], role: number): any[] => {
  return routes
    .map(route => {
      if (!route.meta.authId.inculdes(role)) {
        return null
      }
      if (route.children) {
        const childrenRouter = filterRouter(route.children, role)
        if (childrenRouter.length > 0) {
          return {
            ...route,
            children: childrenRouter,
          }
        }
        return null
      }
      return route
    })
    .filter(Boolean)
}
export const routerMenu = (routes: any[], parentPath: string = ""): any[] => {
  return routes
    .filter(route => !route.meta.hidden)
    .map(route => {
      // 拼接完整路径
      const fullPath = `${parentPath}/${route.path}`
      return {
        key: fullPath,
        label: route.meta.title,
        children: route.children
          ? routerMenu(route.children, fullPath)
          : undefined,
      }
    })
}
export const BBa = ()=>{
  
}